/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.login.plugin.login.view;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.net.Uri;
import android.text.SpannableString;
import android.text.TextPaint;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager.LayoutParams;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.RelativeLayout;
import android.widget.RelativeLayout.LayoutParams;
import android.widget.TextView;
import com.qihoo.gamecenter.sdk.common.i.q;
import com.qihoo.gamecenter.sdk.common.view.CustButton;
import com.qihoo.gamecenter.sdk.login.plugin.d.a;
import com.qihoo.gamecenter.sdk.login.plugin.h.c;

public class FindPasswordDialog extends RelativeLayout implements d {
    private com.qihoo.gamecenter.sdk.login.plugin.f.a a;
    private Activity b;
    private String c;
    private Intent d;
    private f e;
    private RelativeLayout f;
    private TextView g;
    private CustButton h;
    private TextView i;
    private ImageView j;
    private int k = 0;
    private View.OnClickListener l = new View.OnClickListener() {
        public void onClick(View paramView) {
            if (FindPasswordDialog.b(FindPasswordDialog.this) == paramView) {
                FindPasswordDialog.c(FindPasswordDialog.this).a(2, null);
            }
            else if (FindPasswordDialog.d(FindPasswordDialog.this) == paramView) {
                Uri localUri = Uri.parse("mailto:" + com.qihoo.gamecenter.sdk.login.plugin.d.a(d.a.aM));
                Intent localIntent = new Intent("android.intent.action.SENDTO");
                localIntent.setType("plain/text");
                localIntent.setData(localUri);
                FindPasswordDialog.a(FindPasswordDialog.this).startActivity(
                        Intent.createChooser(localIntent, com.qihoo.gamecenter.sdk.login.plugin.d.a(d.a.aK)));
            }
            else {
                if ((FindPasswordDialog.e(FindPasswordDialog.this) != paramView)
                        || (null == FindPasswordDialog.c(FindPasswordDialog.this)))
                    return;
                FindPasswordDialog.c(FindPasswordDialog.this).a(2, null);
            }
        }
    };

    public FindPasswordDialog(Activity paramActivity, String paramString, Intent paramIntent, f paramf) {
        super(paramActivity);
        this.b = paramActivity;
        this.c = paramString;
        this.d = paramIntent;
        this.e = paramf;
        this.a = com.qihoo.gamecenter.sdk.login.plugin.f.a.a(this.b);
        d();
    }

    private void d() {
        setBackgroundDrawable(this.a.a(-1073741797));
        setLayoutParams(new RelativeLayout.LayoutParams(com.qihoo.gamecenter.sdk.login.plugin.h.f.a(this.b, 320.0F), -2));
        setGravity(17);
        a(this.b);
    }

    private void a(Context paramContext) {
        int i1 = com.qihoo.gamecenter.sdk.login.plugin.h.f.a(paramContext, 8.0F) * 2;
        RelativeLayout.LayoutParams localLayoutParams = new RelativeLayout.LayoutParams(-1, -2);
        localLayoutParams.leftMargin = i1;
        localLayoutParams.rightMargin = i1;
        localLayoutParams.topMargin = i1;
        localLayoutParams.bottomMargin = i1;
        this.f = new RelativeLayout(paramContext);
        this.f.setLayoutParams(localLayoutParams);
        addView(this.f);
        this.f.addView(c(paramContext));
        this.f.addView(d(paramContext));
        this.f.addView(e(paramContext));
        this.f.addView(f(paramContext));
        this.f.addView(g(paramContext));
        this.f.addView(h(paramContext));
        addView(b(paramContext));
    }

    private View b(Context paramContext) {
        RelativeLayout.LayoutParams localLayoutParams = new RelativeLayout.LayoutParams(
                com.qihoo.gamecenter.sdk.login.plugin.h.f.a(paramContext, 34.0F),
                com.qihoo.gamecenter.sdk.login.plugin.h.f.a(paramContext, 34.0F));
        localLayoutParams.addRule(5, -1);
        localLayoutParams.leftMargin = com.qihoo.gamecenter.sdk.login.plugin.h.f.a(paramContext, 12.0F);
        localLayoutParams.topMargin = com.qihoo.gamecenter.sdk.login.plugin.h.f.a(paramContext, 16.0F);
        this.j = new ImageView(paramContext);
        int i1 = com.qihoo.gamecenter.sdk.login.plugin.h.f.a(paramContext, 4.0F);
        this.j.setPadding(i1, i1, i1, i1);
        this.j.setScaleType(ImageView.ScaleType.FIT_XY);
        this.j.setLayoutParams(localLayoutParams);
        this.j.setOnClickListener(this.l);
        this.j.setScaleType(ImageView.ScaleType.FIT_XY);
        this.a.a(this.j, 1073741877, 1073741878, 1073741878);
        return this.j;
    }

    private TextView c(Context paramContext) {
        TextView localTextView = new TextView(paramContext);
        RelativeLayout.LayoutParams localLayoutParams = new RelativeLayout.LayoutParams(-2, -2);
        localLayoutParams.addRule(14, -1);
        localLayoutParams.topMargin = com.qihoo.gamecenter.sdk.login.plugin.h.f.a(paramContext, 6.0F);
        localLayoutParams.bottomMargin = com.qihoo.gamecenter.sdk.login.plugin.h.f.a(paramContext, 18.0F);
        localTextView.setLayoutParams(localLayoutParams);
        localTextView.setId(e.e.ordinal());
        localTextView.setGravity(17);
        localTextView.setTextSize(1, c.g);
        localTextView.setTextColor(Color.parseColor("#FF7F16"));
        TextPaint localTextPaint = localTextView.getPaint();
        localTextPaint.setFakeBoldText(true);
        localTextView.setText(com.qihoo.gamecenter.sdk.login.plugin.d.a(d.a.dS));
        return localTextView;
    }

    private TextView d(Context paramContext) {
        TextView localTextView = new TextView(paramContext);
        RelativeLayout.LayoutParams localLayoutParams = new RelativeLayout.LayoutParams(-1, -2);
        localLayoutParams.bottomMargin = com.qihoo.gamecenter.sdk.login.plugin.h.f.a(paramContext, 14.0F);
        localLayoutParams.addRule(3, e.e.ordinal());
        localTextView.setLayoutParams(localLayoutParams);
        localTextView.setId(e.f.ordinal());
        localTextView.setTextColor(-16777216);
        localTextView.setTextSize(1, c.g);
        localTextView.setGravity(16);
        this.a.a(localTextView, 1073741837, 0, 0, 0);
        localTextView.setText(com.qihoo.gamecenter.sdk.login.plugin.d.a(d.a.bJ));
        localTextView.setCompoundDrawablePadding(com.qihoo.gamecenter.sdk.login.plugin.h.f.a(paramContext, 6.0F));
        return localTextView;
    }

    private TextView e(Context paramContext) {
        RelativeLayout.LayoutParams localLayoutParams = new RelativeLayout.LayoutParams(-1, -2);
        localLayoutParams.addRule(3, e.f.ordinal());
        localLayoutParams.addRule(14, -1);
        localLayoutParams.leftMargin = com.qihoo.gamecenter.sdk.login.plugin.h.f.a(paramContext, 16.0F);
        localLayoutParams.bottomMargin = com.qihoo.gamecenter.sdk.login.plugin.h.f.a(paramContext, 20.0F);
        this.i = new TextView(paramContext);
        this.i.setLayoutParams(localLayoutParams);
        this.i.setId(e.g.ordinal());
        this.i.setTextColor(Color.parseColor("#666666"));
        this.i.setTextSize(1, c.g);
        SpannableString localSpannableString = new SpannableString(com.qihoo.gamecenter.sdk.login.plugin.d.a(d.a.bK));
        com.qihoo.gamecenter.sdk.login.plugin.h.f.a(this.i, localSpannableString, new a(Color.parseColor("#666666"), 1,
                -1), 2, 10, 1, 11);
        return this.i;
    }

    private TextView f(Context paramContext) {
        RelativeLayout.LayoutParams localLayoutParams = new RelativeLayout.LayoutParams(-1, -2);
        localLayoutParams.bottomMargin = com.qihoo.gamecenter.sdk.login.plugin.h.f.a(paramContext, 14.0F);
        localLayoutParams.addRule(3, e.g.ordinal());
        TextView localTextView = new TextView(paramContext);
        localTextView.setId(e.h.ordinal());
        localTextView.setLayoutParams(localLayoutParams);
        localTextView.setTextColor(-16777216);
        localTextView.setTextSize(1, c.g);
        localTextView.setText(com.qihoo.gamecenter.sdk.login.plugin.d.a(d.a.bL));
        this.a.a(localTextView, 1073741837, 0, 0, 0);
        localTextView.setCompoundDrawablePadding(com.qihoo.gamecenter.sdk.login.plugin.h.f.a(paramContext, 6.0F));
        return localTextView;
    }

    private TextView g(Context paramContext) {
        RelativeLayout.LayoutParams localLayoutParams = new RelativeLayout.LayoutParams(-1, -2);
        localLayoutParams.addRule(3, e.h.ordinal());
        localLayoutParams.addRule(14, -1);
        localLayoutParams.bottomMargin = com.qihoo.gamecenter.sdk.login.plugin.h.f.a(paramContext, 20.0F);
        localLayoutParams.leftMargin = com.qihoo.gamecenter.sdk.login.plugin.h.f.a(paramContext, 16.0F);
        this.g = new TextView(paramContext);
        this.g.setLayoutParams(localLayoutParams);
        this.g.setId(e.i.ordinal());
        this.g.setTextColor(Color.parseColor("#666666"));
        this.g.setTextSize(1, c.g);
        SpannableString localSpannableString = new SpannableString(com.qihoo.gamecenter.sdk.login.plugin.d.a(d.a.bM));
        com.qihoo.gamecenter.sdk.login.plugin.h.f.a(this.g, localSpannableString, new a(Color.parseColor("#666666"), 1,
                0), 5, 18, 4, 18);
        return this.g;
    }

    private LinearLayout h(Context paramContext) {
        RelativeLayout.LayoutParams localLayoutParams = new RelativeLayout.LayoutParams(-1, -2);
        localLayoutParams.addRule(3, e.i.ordinal());
        localLayoutParams.bottomMargin = com.qihoo.gamecenter.sdk.login.plugin.h.f.a(paramContext, 14.0F);
        LinearLayout localLinearLayout = new LinearLayout(paramContext);
        localLinearLayout.setLayoutParams(localLayoutParams);
        localLinearLayout.setOrientation(0);
        localLinearLayout.setGravity(17);
        this.h = new CustButton(paramContext);
        this.h.setId(e.j.ordinal());
        this.h.setLayoutParams(new LinearLayout.LayoutParams(-1, com.qihoo.gamecenter.sdk.login.plugin.h.f.a(this.b,
                47.0F)));
        this.h.setGravity(17);
        this.h.setTextColor(-1);
        this.h.setText(com.qihoo.gamecenter.sdk.login.plugin.d.a(d.a.v));
        this.h.a();
        this.h.b();
        this.h.setOnClickListener(this.l);
        this.a.a(this.h, -1073741764, -1073741763, -1073741763);
        localLinearLayout.addView(this.h);
        return localLinearLayout;
    }

    public void c() {
        setVisibility(0);
        com.qihoo.gamecenter.sdk.login.plugin.h.f.a(this.b);
        this.k = this.b.getWindow().getAttributes().softInputMode;
        this.b.getWindow().setSoftInputMode(3);
    }

    public void a() {
        setVisibility(8);
        this.b.getWindow().setSoftInputMode(this.k);
    }

    public void b() {
        setVisibility(0);
    }

    private class a extends a {
        private int d = -16777216;

        public a(int paramInt1, int paramInt2, int paramInt3) {
            super(paramInt2, paramInt3);
            this.d = paramInt1;
        }

        public void onClick(View paramView) {
            if (FindPasswordDialog.f(FindPasswordDialog.this) == paramView) {
                try {
                    Intent localIntent1 = new Intent("android.intent.action.VIEW", Uri.parse("http://i.360.cn"));
                    localIntent1.addFlags(268435456);
                    FindPasswordDialog.a(FindPasswordDialog.this).startActivity(localIntent1);
                } catch (Exception localException1) {
                    q.a(FindPasswordDialog.a(FindPasswordDialog.this),
                            com.qihoo.gamecenter.sdk.login.plugin.d.a(d.a.dF));
                    com.qihoo.gamecenter.sdk.login.plugin.h.e
                            .b("FindPasswordDialog", "onClick error!", localException1);
                }
            }
            else {
                if (FindPasswordDialog.d(FindPasswordDialog.this) != paramView)
                    return;
                try {
                    Uri localUri = Uri.parse("mailto:" + com.qihoo.gamecenter.sdk.login.plugin.d.a(d.a.aM));
                    Intent localIntent2 = new Intent("android.intent.action.SENDTO");
                    localIntent2.setType("plain/text");
                    localIntent2.setData(localUri);
                    FindPasswordDialog.a(FindPasswordDialog.this).startActivity(
                            Intent.createChooser(localIntent2, com.qihoo.gamecenter.sdk.login.plugin.d.a(d.a.aK)));
                } catch (Exception localException2) {
                    q.a(FindPasswordDialog.a(FindPasswordDialog.this),
                            com.qihoo.gamecenter.sdk.login.plugin.d.a(d.a.dG));
                    com.qihoo.gamecenter.sdk.login.plugin.h.e
                            .b("FindPasswordDialog", "onClick error!", localException2);
                }
            }
        }

        public void updateDrawState(TextPaint paramTextPaint) {
            paramTextPaint.setColor(this.d);
            paramTextPaint.setUnderlineText(false);
            paramTextPaint.bgColor = 0;
        }
    }
}